<template>
  <div class="subject">
    <div v-for="item in arr" :key="item.id">
      <span>{{ item.num1 }}</span>
      <span>+</span>
      <span>{{ item.num2 }}</span>
      <span>=</span>
      <input type="number" v-model="item.sumadd" :disabled="item.jin == true" />
      <button @click="btn(item)" :disabled="item.jin == true">提交</button>
    </div>
  </div>
</template>

<script>
export default {
  // watch: {
  //   val(newVal) {
  //     this.$emit("btnType", newval);
  //   },
  // val: {
  //   handler(newVal) {
  //     this.$emit("btnType", newval);
  //   },
  // },
  // deep: true,
  // },
  props: ["arr"],
  data() {
    return {};
  },
  methods: {
    btn(item) {
      this.$emit("btnType", item);
    },
  },
};
</script>

<style scoped>
.subject {
  margin: 5px;
  padding: 5px;
  font-size: 20px;
}
.subject span {
  display: inline-block;
  text-align: center;
  width: 20px;
}
.subject input {
  width: 50px;
  height: 20px;
}
</style>